package com.cmcc.volte.www.signal;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;


public class UtilAction{

	private String xdrId;

	public static Integer interfaceStr(String interStr){
		Map<String,Integer> map = new HashMap<String,Integer>();
		map.put("Uu",1);
		map.put("X2",2);
		map.put("UE_MR",3);
		map.put("Cell_MR",4);
		map.put("S1-MME",5);
		map.put("S6a",6);
		map.put("S11",7);
		map.put("S10",8);
		map.put("SGs",9);
		map.put("S5/S8",10);
		map.put("S1-U",11);
		map.put("Gn-C",12);
		map.put("Gm",13);
		map.put("Mw",14);
		map.put("Mg",15);
		map.put("Mi",16);
		map.put("Mj",17);
		map.put("ISC",18);
		map.put("Sv",19);
		map.put("Cx",20);
		map.put("Dx",21);
		map.put("Sh",22);
		map.put("Dh",23);
		map.put("Zh",24);
		map.put("Gx",25);
		map.put("Rx",26);
		map.put("I2",27);
		map.put("Nc",28);
		map.put("ATCF-SCCAS",29);
		map.put("Ut",30);
		return map.get(interStr);
	}
	
	public static String strInterface(Integer integer){
		Map<Integer,String> map = new HashMap<Integer,String>();
		map.put(1,"Uu");
		map.put(2,"X2");
		map.put(3,"UE_MR");
		map.put(4,"Cell_MR");
		map.put(5,"S1-MME");
		map.put(6,"S6a");
		map.put(7,"S11");
		map.put(8,"S10");
		map.put(9,"SGs");
		map.put(10,"S5/S8");
		map.put(11,"S1-U");
		map.put(12,"Gn-C");
		map.put(13,"Gm");
		map.put(14,"Mw");
		map.put(15,"Mg");
		map.put(16,"Mi");
		map.put(17,"Mj");
		map.put(18,"ISC");
		map.put(19,"Sv");
		map.put(20,"Cx");
		map.put(21,"Dx");
		map.put(22,"Sh");
		map.put(23,"Dh");
		map.put(24,"Zh");
		map.put(25,"Gx");
		map.put(26,"Rx");
		map.put(27,"I2");
		map.put(28,"Nc");
		map.put(29,"ATCF-SCCAS");
		map.put(30,"Ut");
		return map.get(integer);
	}
	
	public static long caculateStartTime(String procedureStartTime) {
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置日期格式
		long ns = 1000;// 一秒钟的毫秒数;
		long start = 0;
		long end = 0;
		try {
			end = df.parse(procedureStartTime).getTime();
		} catch (ParseException e) {
		}
		long diff = end - start;
		// 计算差多少秒//输出结果
		long sec = diff / ns;
		return sec;

	}
	public String getXdrId() {
		return xdrId;
	}

	public void setXdrId(String xdrId) {
		this.xdrId = xdrId;
	}

}